	{% include "../includes/head.html" %}
	<body>
		{% include "../includes/header.html" %}
		
		{% include "../includes/navbar.html" %}
		
		<div class="content">
			<div>Quiz: <b>{{ quiz.title }}</b></div>
			<br>
				
			{% if not sessions %}
				<div>This quiz has not been taken yet</div>
			{% else %}
			<div><b>Sessions {{ first|add:1 }}-{{ last }}</b>
			{% if not atfirst %}<a href="/sessions?quiz={{ quiz.key }}&first={{ previous }}"><span class="arrows"><</span>Previous {{ count }}</a>{% endif %}
			{% if not atlast %}<a href="/sessions?quiz={{ quiz.key }}&first={{ first|add:count }}">Next {{ count }}<span class="arrows">></span></a>{% endif %}
			</div>
			<table>
			<tr align="left">
				<th>Started</th>
				<th>Completed</th>
				<th>Mode</th>
				<th>Answered</th>
				<th>Correct</th>
				<th>Percentage</th>
				<th>Actions</th>
			</tr>
			
			{% for session in sessions %}
				<tr {% if forloop.counter|divisibleby:2 %}class="evenrow"{% endif %}>
				<td>{{ session.timestarted|date:"Y-m-d H:i:s T" }}</td>
				<td>{% if session.timecompleted %}{{ session.timecompleted|date:"Y-m-d H:i:s T" }}{% endif %}</td>
				<td>
					{% ifequal session.mode "SEQ" %}Sequential{% endifequal %}
					{% ifequal session.mode "RET" %}Retry{% endifequal %}
				</td>
				<td>{{ session.questions_answered }}</td>
				<td>{{ session.number_correct }}</td>
				<td>{{ session.percentage_correct|default_if_none:0|floatformat }}%</td>
				<td>
					<a href="/responses?session={{ session.key }}">Responses</a>
					<a href="/resume?session={{ session.key }}">Resume</a>
					<a href="/delete?session={{ session.key }}">Delete</a>
				</td>
				</tr>
			{% endfor %}
			<tr><td colspan="7" align="right">
			<div><b>Sessions {{ first|add:1 }}-{{ last }}</b>
			{% if not atfirst %}<a href="/sessions?quiz={{ quiz.key }}&first={{ previous }}"><span class="arrows"><</span>Previous {{ count }}</a>{% endif %}
			{% if not atlast %}<a href="/sessions?quiz={{ quiz.key }}&first={{ first|add:count }}">Next {{ count }}<span class="arrows">></span></a>{% endif %}
			</div>
			</td></tr>
			</table>
			{% endif %}
		</div>
	</body>
</html>